import request from '@/utils/request'

// 领料单列表
export function materialRequisitionList(data) {
    return request({
        url: '/system/materialRequisition/list',
        method: 'get',
        params: data
    })
}

// 获取领料单详细信息
export function materialRequisitionDetail(id) {
    return request({
        url: '/system/materialRequisition/getInfo?id=' + id,
        method: 'get'
    })
}

// 新建领料单
export function materialRequisitionAdd(data) {
    return request({
        url: '/system/materialRequisition/add',
        method: 'post',
        data: data
    })
}

// 编辑领料单
export function materialRequisitionEdit(data) {
    return request({
        url: '/system/materialRequisition/edit',
        method: 'post',
        data: data
    })
}

// 编辑单条数据
export function materialRequisitionEditSingle(data) {
    return request({
        url: '/system/materialRequisitionDetail/edit',
        method: 'post',
        data: data
    })
}

// 审核
export function materialRequisitionCheck(id, status, approveStatus, approveRemark) {
    const data = {
        id,
        status,
        approveStatus,
        approveRemark
    }
    return request({
        url: '/system/materialRequisition/check',
        method: 'post',
        data: data
    })
}

// 扫码领料
export function materialRequisitionScanCode(data) {
    return request({
        url: '/system/materialRequisition/scanCodeToPick',
        method: 'post',
        data: data
    })
}

// 删除扫码
export function materialRequisitionScanCodeDel(data) {
    return request({
        url: '/system/materialRequisition/deleteScanCode',
        method: 'post',
        data: data
    })
}

// 多仓位列表
export function morePositionList(id) {
    return request({
        url: '/system/materialRequisition/getPosition?id=' + id,
        method: 'get',
    })
}

// 多仓位新建数据
export function morePositionAdd(data) {
    return request({
        url: '/system/materialRequisition/addPosition',
        method: 'post',
        data: data
    })
}

// 多仓位编辑数据
export function morePositionEdit(data) {
    return request({
        url: '/system/materialRequisition/editPosition',
        method: 'post',
        data: data
    })
}

// 多仓位仓位编辑
export function morePositionUpdate(data) {
    return request({
        url: '/system/materialRequisition/updatePosition',
        method: 'post',
        data: data
    })
}

// 多仓位单个新建
export function morePositionAddSingle(data) {
    return request({
        url: '/system/productMultiPosition/add',
        method: 'post',
        data: data
    })
}

// 多仓位单个删除
export function morePositionDelSingle(id) {
    return request({
        url: '/system/materialRequisition/removePosition?id=' + id,
        method: 'post'
    })
}

// 确认领料
export function confirmPicking(data) {
    return request({
        url: '/system/materialRequisition/confirmPicking',
        method: 'post',
        data: data
    })
}